-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!(action_pack): Use ActiveSupport instead of patches #703
feat!(action_pack): Use ActiveSupport instead of patches #703
Conversation
|
||
# from rails 6.1, the request will be added to payload | ||
request = payload[:request] | ||
request = payload[:headers].instance_variable_get(:@req) if ::ActionPack.version < Gem::Version.new('6.1.0') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed once the rails 6.0 is no longer supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the Rails 6.0 logic and I will merge this PR for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
...tion/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb
Show resolved
Hide resolved
...tion/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed during the Ruby SIG on 2023-11-21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @xuan-cao-swi, nice work! I have some documentation suggestions.
Tests using the example trace_demonstration.ru
output essentially identical content before and after the change! 🎉
...tion/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb
Outdated
Show resolved
Hide resolved
instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers.rb
Outdated
Show resolved
Hide resolved
instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers.rb
Outdated
Show resolved
Hide resolved
...tion/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
…action_pack/handlers/action_controller.rb Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
…action_pack/handlers.rb Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
…action_pack/handlers/action_controller.rb Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers.rb
Outdated
Show resolved
Hide resolved
...tion/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb
Outdated
Show resolved
Hide resolved
...tion/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb
Outdated
Show resolved
Hide resolved
...tion/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb
Outdated
Show resolved
Hide resolved
…action_pack/handlers/action_controller.rb Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
…action_pack/handlers/action_controller.rb Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
…action_pack/handlers/action_controller.rb Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
…action_pack/handlers.rb Co-authored-by: Kayla Reopelle (she/her) <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Description
Use ActiveSupport::Notification to subscribe the log from action controller, then modify the rack span. Remove the patch on function
dispatch
from metal.rbRelated to #638, #667, issue #218, #635
Test
Added test assertion that focus on error handling.
Tested with rails 6.1.7.1 and 7.1.* that made sure this change has consistent behaviour as original patching.
Tested on basic test suite.